<template>
	<div class="vb">
		{{msg}}	
	</div>
</template>

<script>
	import envUrl from '@assets/js/env3.js'
	export default{
		data(){
			return{
				msg:'左滑或返回回到邮件111...',
			}
		},
		methods:{
			close(){
				this.$cookie.delete('name')
				jme.browser.closeWeb();
			},
			go(){
				// 处理参数
				const num = this.$route.query.fromId
				const fromId = this.$route.query.num
				const status = this.$route.query.status
				const dataId = this.$route.query.dataId
				if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
					setTimeout(()=>{
						const url = encodeURIComponent(`${envUrl}/#/approvalDetails?fromId=${fromId}&num=${num}&status=${status}&lk=xq`)
						jme.browser.openUrl({
							"type":3,
						    "url":`jdme://web/202011020850?url=${url}`
						});
					},0)
				} else {
					setTimeout(()=>{
						location.href = `http://ticket2.jdcloud.com/admin/default.html#modules/formpublish/myformdata.html?num=${fromId}&type=detail&dataId=${dataId}`
					},0)
				}
				
			}
		},
		created(){
			this.go()		
			setInterval(()=>{
				if(this.$cookie.get('name') !== null){
					this.close()
				}
			},1000)
		},
	}
</script>

<style scoped>
	
</style>
